﻿using System.Windows.Controls;
using System.Xml.Linq;
using System.Linq;
using System.Windows.Data;
using Acando.Dynamics.CRM.Silverlight.Library.Converter;
using Acando.Dynamics.CRM.Silverlight.Library.Controls;
using Acando.Dynamics.CRM.Silverlight.Library.Interfaces;
using Microsoft.Windows.Controls;

namespace Acando.Dynamics.CRM.Silverlight.Library.Controls.FieldControls
{
    public partial class CrmNumberControl : BaseValueControl
    {
        public CrmNumberControl(IRecordControl recordControl, string controlType, string fieldName, int decimalPlaces)
            : base(recordControl, controlType, fieldName)
        {
            InitializeComponent();

            this.numValue.DecimalPlaces = decimalPlaces;
            this.numValue.SetBinding(NumericUpDown.ValueProperty, base.GetBinding(recordControl,controlType,fieldName));
            this.numValue.IsEnabled = !recordControl.IsReadOnly;

        }
    }
}
